package com.cloud.cmt.usermanage.service;

import com.cloud.cmt.usermanage.entity.Employee;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by Administrator on 2017/10/21.
 */
@Repository
public interface EmployeeRepository extends JpaRepository<Employee, Long> {
    @Query("select u from Employee u  where u.employeeNum like ?1 or u.name like ?1 or u.phone like ?1 ")
    Page<Employee> findByEmployee(String employeeNum, Pageable pageRequest);

    List<Employee> findByEmployeeNum(String employeeNum);


}
